<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template_dialog.xhtml">
	<ui:define name="head">
		<title>上传文件</title>
	</ui:define>
	<!--  使用说明
		<p:commandButton id="newStatBtn" value="上传文件" actionListener="#{specialMaintenanceStationController.chooseEquipment}">
			<p:ajax event="dialogReturn"  listener="#{specialMaintenanceStationController.onSelectorChosen}" />
		</p:commandButton>
	
	public void chooseEquipment() {
        Map<String,Object> options = new HashMap<String, Object>();
        options.put("resizable", true);
        options.put("draggable", true);
        options.put("modal", true);
        options.put("width", 650);
        options.put("height", 250);
        
        Map<String,List<String>> params = new HashMap<>();
        List<String> param = new ArrayList<>();
        param.add("1");	//设置去除前几行
        params.put("ingnoreRows", param);
        openDialog("/ui/common/upload_excel_dialog", params, options);
    }
	
	public void onSelectorChosen(SelectEvent event) {
		List<List<String>>objs = (List<List<String>>) event.getObject();
		System.out.println(objs);
	}
	 
	 
	-->
	
	<ui:define name="content">
		<div class="col-sm-12" style="height: 300px">
			<h:form id="uploadFileForm">
				<p:outputLabel value="#{excelUploadManagerController.ingnoreRows}" style="width:0;height:0;overflow:hidden"/>
				<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
				<p:fileUpload sizeLimit="1000000" fileLimit="1" invalidFileMessage="只允许后缀名为xlsx的文件" invalidSizeMessage="文件过大"
					 mode="advanced" allowTypes="/(\.|\/)(xlsx)$/" update="messages" fileLimitMessage="只允许上传一个文件" 
					fileUploadListener="#{excelUploadManagerController.handleFileUploadDefine}" />
			</h:form>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script>
			setInterval("timeOut()", "2000")
			function timeOut() {
				setTimeout("messageHide()", 4000);
			}
			function messageHide() {
				var box = document.getElementById("uploadFileForm:messages");
				box.style.display = "none";
			}
		</script>
	</ui:define>
</ui:composition>
